export function closeVerifyDialog (state) {
  state.verifyDialog = false
}

export function close (state) {
  state.info = []
  clearInterval(state.interval)
  state.fields = { host: [], build: [] }
}

export function openVerify (state, payload) {
  state.verifyDialog = true
  state.recentCmd = payload
}

export function loadInfoSuccess (state, payload) {
  state.info = JSON.parse(payload).info
  state.count = payload.count
}

export function loadSelectSuccess (state, payload) {
  state.fields.host = []
  state.host = {items: [{ text: '', value: '' }]}
  let res = JSON.parse(payload)
  for (let i in res.data) {
    res.data[i].avatar = '/statics/' + res.data[i].avatar + '.png'
  }
  state.host.items = res.data
}
